

import librosa
from spafe.utils import vis
from spafe.features.lpc import lpc, lpcc

# init input vars
num_ceps = 13
lifter = 0
normalize = True

# read wav
sig, fs = librosa.load("../test.wav", sr=8000)

# compute lpcs
lpcs = lpc(sig=sig, fs=fs, num_ceps=num_ceps)
print(lpcs.shape)
# visualize features
vis.visualize_features(lpcs, 'LPC Index', 'Frame Index')

# visualize spectogram
vis.spectogram(sig, fs)

# compute lpccs
lpccs = lpcc(sig=sig, fs=fs, num_ceps=num_ceps, lifter=lifter, normalize=normalize)
print(lpccs.shape)
# visualize features
vis.visualize_features(lpccs, 'LPCC Index', 'Frame Index')

# %%
